package DAO;

import entity.db.CitationTextDB;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ：hzs
 * @date ：Created in 2021/1/2 15:41
 * @description：
 * @modified By：
 * @version: $
 */
public class NetworkDAO extends BaseDAO {

    @Deprecated
    public List<CitationTextDB> getKnowledgeFlowNetworkAfterFilter(String whereSql) {
        String sql = "SELECT id, source, target, citation_index, citation, similarity, distribution, noun_phrase, deleted FROM citation_text"
                + whereSql;
        List<List<Object>> lists = executeReadSql(sql);
        List<CitationTextDB> result = new ArrayList<>();
        for (List<Object> list : lists) {
            CitationTextDB citationTextDB = new CitationTextDB();
            citationTextDB.setId((int)list.get(0));
            citationTextDB.setSource((int)list.get(1));
            citationTextDB.setTarget((int)list.get(2));
            citationTextDB.setCitationIndex((String)list.get(3));
            citationTextDB.setCitation((String)list.get(4));
            citationTextDB.setSimilarity((String)list.get(5));
//            citationTextDB.setDistribution((String)list.get(6));
//            citationTextDB.setNounPhrase((String)list.get(7));
            citationTextDB.setDeleted((int)list.get(8));
            result.add(citationTextDB);
        }
        return result;
    }

}
